package edu.nanyang.struts;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.json.annotations.JSON;

import com.opensymphony.xwork2.ActionSupport;

import edu.nanyang.domain.User;
import edu.nanyang.hibernate.IManageBasicInfo;

public class ManageBasicinfoAction extends ActionSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private IManageBasicInfo imanageinfo;
	private User user;
	private int userid;
	
	public int getUserid() {
		return userid;
	}

	public void setUserid(int userid) {
		this.userid = userid;
	}

	@JSON(serialize=false)
	public IManageBasicInfo getImanageinfo() {
		return imanageinfo;
	}

	public void setImanageinfo(IManageBasicInfo imanageinfo) {
		this.imanageinfo = imanageinfo;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String acquireSelfBasicInfo(){
		userid=(Integer)ServletActionContext.getRequest().getSession().getAttribute("userid");
		System.out.println("userid===="+userid);
		user=imanageinfo.basicinfo(userid);
		return SUCCESS;
		
	}

}
